@extends('admin::layouts.master')
@section('content')
    <div class="">

        <div class="clearfix"></div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>添加轮播图
                            <small>请填写轮播图</small>
                        </h2>

                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">

                        <form action="/silder/silder" method="POST" class="form-horizontal form-label-left">
                            @csrf
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="email">轮播图标题 <span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input type="text" id="email2" name="title" data-validate-linked="email" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>

                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="email">跳转地址 <span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input type="text" id="email2" name="url" data-validate-linked="email" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">缩略图 <span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <div id="container">
                                        <!--头部，相册选择和格式选择-->
                                        <input type="hidden" name="images" id="imageArrFrom" value="">
                                        <div id="uploader">
                                            <div class="queueList">
                                                <div id="dndArea" class="placeholder">
                                                    <div id="filePicker"></div>
                                                    <p>或将照片拖到这里，单次最多可选300张</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <input type="hidden" name="file" class="previewSrc">

                            </div>

                            <div class="form-group" id="app">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">是否显示</label>
                                <div class="col-md-9 col-sm-9 col-xs-12">

                                    <div class="" style="margin-top: 7px;">
                                        <input name="is_show" type="radio" checked value="1">是
                                        <input name="is_show" type="radio" value="2"> 否
                                    </div>
                                </div>
                            </div>

                            <div class="ln_solid"></div>
                            <div class="form-group">
                                <div class="col-md-6 col-md-offset-3">
                                    <button type="submit" class="btn btn-success">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('scripts')
    <script>
        // 异步添加方法
        function add(){
            $.post('/admin/article',{
                '_token':'{{csrf_token()}}',
                'data':data
            }, function(res) {
                console.log(res);
                if(res.valid) {
                    swal("添加成功", {
                        icon: "success",
                    })
                        .then(() => {
                            location.href = '/admin/article';
                        })
                }
            },'json');
        }
    </script>

@endsection


